Skip to main content

revRotatePoly

Type

command

Summary

Rotates a graphic by a specified angle.

Syntax

revRotatePoly <graphicReference>, <angleInDegrees>

Description

Use the revRotatePoly command to rotate a line, curve, or irregular polygon graphic.

Important

The revRotatePoly command does not accept direct graphic references. For example, the following statement causes an error message:

    revRotatePoly graphic \"My Graphic\",45 -- CAN\'T USE THIS FORM

Instead, use a form that evaluates to a graphic reference, like this:

    revRotatePoly the name of graphic \"My Graphic\",90 -- use this form
revRotatePoly (\"field\" && quote & \"My Field\" & quote),22 -- or this

The angleInDegrees is a number, or an expression that evaluates to a number.

If the angleInDegrees is positive, the image rotates counterclockwise. If the angleInDegrees is negative, the image rotates clockwise.

note

When included in a standalone application, the Common library is implemented as a hidden group and made available when the group receives its first openBackground message. During the first part of the application's startup process, before this message is sent, the revRotatePoly command is not yet available. This may affect attempts to use this command in startup, preOpenStack, openStack, or preOpenCard handlers in the main stack. Once the application has finished starting up, the library is available and the revRotatePoly command can be used in any handler.

Parameters

NameTypeDescription

graphicReference

Any expression that evaluates to a reference to a graphic whose style property is set to "line", "curve", or "polygon" .

angleInDegrees

A number, or an expression that evaluates to a number.

Examples

revRotatePoly the long ID of graphic "My Curve",45 -- rotates 45 degrees
revRotatePoly "graphic" && it, 10 * theStartAngle
revRotatePoly the name of graphic 3 of stack "Draw", field "Rotate by"

property: angle

command: flip, rotate

glossary: command, evaluate, main stack, handler, message, group, standalone application, expression, statement, graphic, application

keyword: select, graphic

library: Common library, library

message: startup, openBackground, preOpenStack, openStack, preOpenCard

Compatibility and Support

Introduced

LiveCode 1.1.1

OS

mac

windows

linux

Platforms

desktop

server

Thank you for your feedback!

Was this page helpful?